<?php
/**
 * Role.php
 * Created by PhpStorm.
 * User: 江小波
 * Date: 2019/06/07
 * Time: 12:32
 */
namespace app\common\simple_rbac;

use app\common\Singleton;

class Role
{
    use Singleton;

    public function setNodes($roleList)
    {
        foreach($roleList as &$role)
        {
            if(empty($role['nodes']))
            {
                $role['nodes'] = [];
            }else{
                $role['nodes'] = explode(",",trim($role['nodes'],','));
            }
        }
        return $roleList;
    }
}